﻿using AppService.IService.System_operation;
using AppService.Service.System_operation;
using Domain.Entity.System_operation;
using Domain.Entity.System_Ordermanagement;
using Microsoft.AspNetCore.Mvc;

namespace WebAPI.Controllers.System_operation
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class Receipt_meterController : ControllerBase
    {
        private readonly IReceipt_meterService Ireceipt_meterService;

        public Receipt_meterController(IReceipt_meterService ireceipt_meterService)
        {
            Ireceipt_meterService = ireceipt_meterService;
        }

        [HttpGet]
        public int Count(string? Sign_time, string? value2, string? Receipt_type, string? Ord_state)
        {
            return Ireceipt_meterService.Count(Sign_time, value2, Receipt_type, Ord_state);
        }

        /// <summary>
        /// 分页查询
        /// </summary>
        /// <param name="currentPage"></param>
        /// <param name="PageSize"></param>
        /// <returns></returns>
        [HttpGet("{currentPage},{PageSize}")]
        public List<Receipt_meter> GetReceipt_meter(int currentPage, int PageSize)
        {
            return Ireceipt_meterService.GetReceipt_meter(currentPage, PageSize);
        }

        [HttpGet("{id}")]
        public Orders GetOrd_id(int id)
        {
            return Ireceipt_meterService.GetOrd_id(id);
        }

        [HttpGet("{id}")]
        public Signature_receipt GetSign_id(int id)
        {
            return Ireceipt_meterService.GetSign_id(id);
        }

        [HttpPut]
        public bool BC([FromBody] Receipt_meter receipt_Meter)
        {
            return Ireceipt_meterService.BC(receipt_Meter);
        }
    }
}
